/*   time:2019-06-13 20:39:24*/
var e = getApp(),
    t = e.requirejs("core"),
    a = e.requirejs("wxParse/wxParse"),
    s = e.requirejs("jquery");
Page({
    data: {
        route: "member",
        icons: e.requirejs("icons"),
        member: {},
        audios: {},
        audiosObj: {},
        modelShow: !1,
        autoplay: !0,
        interval: 5e3,
        duration: 500,
        swiperheight: 0,
        iscycelbuy: !1,
        bargain: !1,
        result: {},
        level: 1,
        page: 1,
        page1:1,
        list: [],
        list1:[],
        status:0
    },
    onLoad: function(t) {
        e.checkAuth(), this.setData({
            options: t
        })
    },
    getInfo: function() {
        var i = this;
        t.get("member", {}, function(e) {
            1 == e.isblack && wx.showModal({
                title: "无法访问",
                content: "您在商城的黑名单中，无权访问！",
                success: function(e) {
                    e.confirm && i.close(), e.cancel && i.close()
                }
            }), 0 != e.error ? wx.redirectTo({
                url: "/pages/message/auth/index"
            }) : i.setData({
                member: e,
                show: !0,
                customer: e.customer,
                customercolor: e.customercolor || "",
                phone: e.phone,
                phonecolor: e.phonecolor || "",
                phonenumber: e.phonenumber || "",
                iscycelbuy: e.iscycelbuy,
                bargain: e.bargain
            }), a.wxParse("wxParseData", "html", e.copyright, i, "5")
        })
    },
    onShow: function() {
        e.checkAuth();
        var a = this;
        this.getInfo(), wx.getSystemInfo({
            success: function(e) {
                var t = e.windowWidth / 1.7;
                a.setData({
                    windowWidth: e.windowWidth,
                    windowHeight: e.windowHeight,
                    swiperheight: t
                })
            }
        }), a.setData({
            imgUrl: e.globalData.approot
        }),this.getList()
    },
    getList: function() {
        var a = this;
        if(a.data.status == 0){
            var pagenow = a.data.page
        }else{
            var pagenow = a.data.page1
        }
        t.get("commission/down/get_list", {
            page: pagenow,
            level: a.data.level
        }, function(t) {
            
            if(a.data.status == 0){
                var e = {
                    total: t.total,
                    pagesize: t.pagesize
                };
                0 < t.list.length && (e.page = a.data.page + 1, e.list = a.data.list.concat(t.list), t.list.length < t.pagesize && (e.loaded = !0)), a.setData(e)
            }else{
                var e = {
                    pagesize: t.pagesize
                };
                0 < t.list.length && (e.page1 = a.data.page1 + 1, e.list1 = a.data.list1.concat(t.list), t.list.length < t.pagesize && (e.loaded = !0)), a.setData(e)
            }
            
        }, this.data.show)
    },
    myTab: function(e) {
        var a = t.pdata(e).level;
        this.setData({
            level: a,
            page: 1,
            list: []
        }), this.getList()
    },
    selected: function(event){
        var i = this
        i.setData({
            status:event.currentTarget.dataset.type,
            level:Number(event.currentTarget.dataset.type)+1,
        }),i.getList()
    },
    //到达底部
    scrollToLower: function (e) {
        var a = this;
        /*if(a.data.status == 0){
            this.setData({
                page: a.data.page + 1
            })
        }else{
            this.setData({
                page1: a.data.page1 + 1
            })
        }*/
        a.getList();
    },
    onHide: function() {
        
    },
    onUnload: function() {
        
    },
    
});